package sk.mangos.realmd;

import java.io.*;
import java.net.Socket;

/**
 * @author sk.z
 */
public class AuthSocketClient {

    private static final int LISTEN_PORT = 3724;    //服务器监听端口

    public static void main(String[] args) throws IOException {
        Socket client = new Socket("127.0.0.1", LISTEN_PORT);

        OutputStream output = client.getOutputStream();
        InputStream input = client.getInputStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));

        byte[] content = new byte[]{0,3,33,0,87,111,87,0,1,12,1,-13,22,54,56,120,0,110,105,87,0,78,67,104,122,-32,1,0,0,127,0,0,1,3,49,50,51};
        output.write(content);

        byte[] block = new byte[8];
        int length = input.read(block);
        System.out.println("length : "+ length + " : " + new String(block));

        reader.close();

        client.close();
    }
}
